package com.example.user_service;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {
    @RequestMapping("/findUser")
    public String findUser() {
        return "findUser";
    }

    @RequestMapping("/findUserById")
    public String findUserById(@RequestParam String id) {
        return "findUserById id: " + id;
    }

    @RequestMapping("/findUserByName")
    public String findUserByName(@RequestHeader String name, @RequestHeader Integer id) {
        return "findUserByName name : " + name;
    }

    @RequestMapping("/insertUser")
    public String insertUser(@RequestBody User user) {
        return "insertUser " + user.getUserName();
    }
}
